<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>分割与连接字符串</title>
<script type="text/javascript">
var str="www-baidu-com";
var strUrls=str.split("-");
for(var i=0;i<strUrls.length;i++)
{
	document.write(strUrls[i]+"<br/>");
}
var url="";
for(var i=0;i<strUrls.length-1;i++)
{
	url=url+strUrls[i].concat(".");
}
	url+=strUrls[strUrls.length-1];
document.write(url);
</script>
</head>

<body>
</body>
</html>
